package test.rxjava.com.testmvplib;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;

import com.zhon.baselib.mvpbase.baseImpl.BaseActivity;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import bean.TestBean;
import contact.TestContact;
import presenter.MainPresenter;

public class MainActivity extends BaseActivity<TestContact.presenter> implements TestContact.view {
    private Map<String,String> map = new HashMap<>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        map.put("menu","红烧肉");
        map.put("key","f44ad1c4c65eee8f3c0dd378a27d4fb6");

        presenter.getData();//调用此方法,请求网络
    }

    //初始化Presenter
    @Override
    public TestContact.presenter initPresenter() {
        return new MainPresenter(this,map);
    }

    //获取到的网络数据
    @Override
    public void setData(List<TestBean.ResultBean.DataBean> dataList) {
        Log.v("TAG",dataList.size()+"....");

    }
}
